require(['./config'],() => {
	require(['header','footer'],() =>{
		class Sign {
			constructor() {
			    this.zhuce()
			}
			zhuce (){
				$('.signnow>input').on('click', () => {
					const pwd = $('.password>input').val()
					const conpwd = $('.confirmpassword>input').val()
					const name = $('.phonenum>input').val()
					
					if (pwd === conpwd) {
						const userinfo = {name,pwd}
						console.log(userinfo)
						let userList = localStorage.getItem('userList')
						if (userList) {
							userList = JSON.parse(userList)
							userList.push(userinfo)
							localStorage.setItem('userList',JSON.stringify(userList))
						}else{
							const arr = [userinfo]
							localStorage.setItem('userList',JSON.stringify(arr))
						}
						
						alert('注册成功，欢迎加入唯一客')
					    window.open('/html/logon.html','_self')
						}
						
						else{
							alert('请再次确认密码')
						}
					
				})
			}
		}
		new Sign()
	})

})